// const moduleInfo = module.info;

const schemas = {};
// post
schemas.post = {
  type: 'object',
  properties: {
    atomId: {
      type: 'number',
    },
    // title
    __groupTitle: {
      ebType: 'group-flatten',
      ebTitle: 'Title',
    },
    atomName: {
      type: 'string',
      ebType: 'text',
      ebTitle: 'Atom Name',
      notEmpty: true,
    },
    // content
    __groupContent: {
      ebType: 'group-flatten',
      ebTitle: 'Content',
    },
    content: {
      type: 'string',
      ebType: 'markdown-content-cms',
      ebTitle: 'Content',
    },
    // Basic Info
    __groupBasicInfo: {
      ebType: 'group-flatten',
      ebTitle: 'Basic Info',
      ebGroupWhole: true,
    },
    atomLanguage: {
      type: 'string',
      ebType: 'language',
      ebTitle: 'Language',
      notEmpty: true,
    },
    atomCategoryId: {
      type: 'number',
      ebType: 'category',
      ebTitle: 'Category',
      notEmpty: true,
    },
    atomTags: {
      type: ['string', 'null'],
      ebType: 'tags',
      ebTitle: 'Tags',
    },
  },
};
// post search
schemas.postSearch = {
  type: 'object',
  properties: {
    html: {
      type: 'string',
      ebType: 'text',
      ebTitle: 'Content',
      ebSearch: {
        tableAlias: 'q',
      },
    },
  },
};
module.exports = schemas;
